#include "can.h"
#include "VESC.h"
int main() {
    int Vel = 0;
    // 示例数据
    std::atomic<bool> running_;
    running_ = true;
    std::thread t1([&](){
        char c;
        while(1){
            std::cin >> Vel;
            if(Vel == 1)break;

        }
        running_ = false;
    });
    VESC_CAN_BUS canbus("can0");
    canbus.insert(new Motor(1));
    while (running_)
    {
        canbus[1].setVel(Vel);
    }
    t1.join();
    

    return 0;
}